<link rel="stylesheet" href="http://www.12301.cc/css/aliceui.min.css"/>
<link rel="stylesheet" href="http://www.12301.cc/css/resetui.css"/>
<link rel="stylesheet" href="http://www.12301.cc/css/prod_store.css"/>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=DE946147d82abf8082f7e80868ea8afb"></script>
<style>
#msg_wrap{
    display: none;
    height:110px;
    padding:50px 80px 30px 80px;
    margin: 0 auto;
    font-family: "微软雅黑";
    background: #FFF;
}
#msg_wrap p{
    text-align: left;
    line-height: 32px;
}
#msg_wrap .first{
    background: url('../images/greenok.png') no-repeat top left;
    padding-left:32px;
    font-size: 16px;
    font-weight: bold;
}
#msg_wrap .second{
    border-bottom:1px dashed #EEE;
    font-size: 14px;
}
#msg_wrap .normal_p{
    font-size:12px;
    font-weight: normal;
    padding: 0 10px;

}
#msg_wrap .normal_p a{
    color: #FFF;
    text-decoration: none;
    margin: 4px 10px;
}
</style>
<div class="wrapper">
<h3 class="mc_title">
    <span class="mctit_1"><span class="mctit_2">产品发布</span></span>
</h3>
<?if(!$isedit||isset($_GET['step'])){?> 
    <ol class="ui-ministep step2">
    <li class="ui-ministep-item">
        <span class="ui-ministep-text">产品类型</span>
    </li>
    <li class="ui-ministep-item ui-ministep-active">
        <span class="ui-ministep-text"><?=$FieldList[$ptype]['ticket']['t4']?></span>
    </li>
    <li class="ui-ministep-item">
        <span class="ui-ministep-text"><?=$FieldList[$ptype]['ticket']['t1']?></span>
    </li>
</ol>
<?}?>
<?
    if($ptype=='F' && !empty($package_data)) {
        include TPLPATH .'_package_box.html';
    }
?>
<div id="sceneryBox" class="ui-box mt10 fn-clear">
    <?if($isedit){?>
        <div class="ui-box-head">
            <h3 class="ui-box-head-title"><?=$ProdTypes[$ptype]?>信息</h3>
            <span class="ui-box-head-text"></span>
            <a href="#" class="ui-box-head-more"></a>
        </div>
    <?}?>

    <div class="ui-box-container">
        <div class="ui-box-content">
            <form name="mainForm" id="mainForm" class="ui-form" method="post" action="call/uploadThumbImage.php" enctype="multipart/form-data" target="hideFrame">
                <input type="hidden" name="lastid" value="<?=$jdata['id']?>"/>
                <input type="hidden" name="applydid" value="<?=$apply_did?>"/>
                <input type="hidden" name="action" value="CreateNewProduct"/>
                <input type="hidden" name="ptype" value="<?=$ptype?>"/>
                <input type="hidden" name="upload_mth" id="upload_mth" value="1"/>
                <?=$input_pack?>
                <fieldset>
                    <?if(!$isedit){?>
<!--                            <input type="hidden" name="parent_id" value=""/>-->
<!--                            <div class="ui-form-item">-->
<!--                                <label class="ui-label">资源方</label>-->
<!--                                <input class="ui-input" id="saler_choice" type="text" value="">-->
<!--                                <span class="ui-form-other ui-form-explain">选择已存在的资源方</span>-->
<!--                                <ul id="salers_ul"></ul>-->
<!--                            </div>-->
                    <?}?>
                    <div class="ui-form-item">
                        <label class="ui-label">
                            <span class="ui-form-required">*</span><?=$FieldList[$ptype]['title']?>
                        </label>
                        <input title="请填写<?=$FieldList[$ptype]['title']?>" class="ui-input check w408" data-required="2" id="mainTitle" name="mainTitle" type="text" autofocus value="<?=$jdata['title']?>">
                        <span class="ui-form-other ui-form-explain">请填写<?=$FieldList[$ptype]['title']?></span>
                    </div>
                    <?if(isset($FieldList[$ptype]['jtype'])){//景点级别?>
                        <div class="land ui-form-item">
                            <?if(is_array($FieldList[$ptype]['jtype'])){?>
                                <label data-s="<?=$jdata['jtype']?>" class="ui-label"><?=$FieldList[$ptype]['jtype']['t']?></label>
                                <?=GetHtmlSelectByValue($FieldList[$ptype]['jtype']['list'],'jtype',$jdata['jtype'])?>
                            <?} else {?>
                                <label class="ui-label">
                                <?=$FieldList[$ptype]['jtype']?>
                                </label>
                                <input class="ui-input w408" name="jtype" type="text" value="<?=$jdata['jtype']?>">
                            <?}?>
                            <span class="ui-form-other ui-form-explain"></span>
                        </div>
                    <?}?>
                    <?if($f_vtime=$FieldList[$ptype]['vtime']){//延迟验证?>
                        <div class="ui-form-item">
                            <label class="ui-label"><?=$f_vtime?></label>
                            <? $delaytime = explode('|', $jdata['delaytime']);?>
                            <input type="radio" name="delaytime" value=0 <? if (!$delaytime[0] && !$delaytime[1]) echo 'checked'; ?> />否&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="radio" name="delaytime" value=1 <? if ($delaytime[0] || $delaytime[1]) echo 'checked'; ?> />是&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="text" name="vtimehour" class="ui-input" style="width:40px" title="请输入延迟小时" value="<?=$delaytime[0]?>"/>&nbsp;小时&nbsp;&nbsp;&nbsp;&nbsp;
                            <input type="text" name="vtimeminu" class="ui-input" style="width:40px" title="请输入延迟分钟" value="<?=$delaytime[1]?>"/>&nbsp;分钟&nbsp;&nbsp;&nbsp;&nbsp;
                            <br><span class="ui-form-explain">是否启用购票到验证的延迟时间，选‘是’请填入小时、分钟，格式为01小时 15分钟</span>
                        </div>
                    <?}?>
 
                        <div class="ui-form-item">
                            <label class="ui-label">
                                <span class="ui-form-required">*</span>所在地区
                            </label>
                            <input type="hidden" value="<?=$jdata['area']?>" name="area"/>
							<input type="hidden" name="start_place_tude" id="result_c" value=""/>
							<input type="hidden"  id="ccid" />
							<input type="hidden"  name="end_place_tude" id="ccid2" value="<?=$var['end_place_tude']?>" />
                            <span id="area"></span>
                        </div>

                    <?if($access['yd']):?>
                        <div class="ui-form-item">
                                <label class="ui-label">私人定制</label>
                                <input type="hidden" value="<?=$jdata['area']?>" name="area"/>
                                <select style="width:120px;" name="custom">
                                    <option value="0" <?if($jdata['custom_made']==0)echo 'selected="selected"'?>>无</option>
                                    <option value="1" <?if($jdata['custom_made']==1)echo 'selected="selected"'?>>吃</option>
                                    <option value="2" <?if($jdata['custom_made']==2)echo 'selected="selected"'?>>住</option>
                                    <option value="3" <?if($jdata['custom_made']==3)echo 'selected="selected"'?>>玩</option>
                                    <option value="4" <?if($jdata['custom_made']==4)echo 'selected="selected"'?>>行</option>
                                </select>
                            </div>
							<?endif;?>
							<?//if($ptype=='A'||$ptype=='B'):?>
                        <div class="ui-form-item">
                            <label class="ui-label">热门度</label>
                            <input type="text" value="<?=$jdata['px']?>" name="px" class="w40 ui-input">
                            <span class="ui-form-explain">热门度是设置产品预订页面显示排序，热门值高，排序越靠前</span>
                        </div>
                    <?//endif;?>
                    <div class="ui-form-item">
                        <label class="ui-label">终端配置:</label>
                            <?php if($jdata['terminal_type']==1):?>
                                已启用
                            <?php else:?>
                            <select name="terminal_type">
                                <option value="0" <?=$jdata['terminal_type']==0?'selected':''?>>不启用</option>
                                <option value="1" <?=$jdata['terminal_type']==1?'selected':''?>>启用</option>
                                <option value="2" <?=$jdata['terminal_type']==2?'selected':''?>>自启用</option>
                            </select>
                                <span class="ui-form-explain">配置是否启用新终端服务器，默认“不启用”</span>
                            <?php endif;?>
                    </div>
                    <?if(isset($FieldList[$ptype]['address'])){//地址?>
                        <div class="land ui-form-item">
                            <label class="ui-label"><span class="ui-form-required">*</span><?=$FieldList[$ptype]['address']?></label>
                            <input type="text" name="mainAddress" id="addressInp" class="w408 ui-input" title="请输入<?=$FieldList[$ptype]['address']?>" value="<?=$jdata['address']?>"/>
                        </div>
                    <?}?>
                    <?if($FieldList[$ptype]['tel']){?>
                        <div class="ui-form-item">
                            <label class="ui-label">联系电话</label>
                            <input type="text" name="mainPhoneNum" id="phone" class="ui-input w408" onBlur="searchByStationName();" title="请输入联系电话" value="<?=$jdata['tel']?>"/>
                            <span class="ui-form-explain">手机或固话（固话格式：区号-电话号码）</span>
                        </div>
                    <?}?>
                    <?if(isset($FieldList[$ptype]['runtime'])){//开放时间?>
                        <div class="land ui-form-item">
                            <label class="ui-label"><?=$FieldList[$ptype]['runtime']?></label>
                            <input class="ui-input w408" id="runtime" name="runtime" type="text" value="<?=$jdata['runtime']?>">
                            <span class="ui-form-other ui-form-explain"></span>
                        </div>
                    <?}?>
					<div id="container" style="position: absolute;margin-top:30px; width: 3px; height: 3px; display:none;top: 50; border: 1px solid gray;overflow:hidden;"></div> 
                    <?if($FieldList[$ptype]['place']){//true?>
                        <div class="land ui-form-item">
							<input type="hidden" name="start_place_tude" id="result_"/>
                            <label class="ui-label"><span class="ui-form-required">*</span>出发地</label>
                            <input class="ui-input" data-required="1" name="start_place" id="text_" type="text" value="<?=!empty($jdata['runtime'])?substr($jdata['runtime'],0,strpos($jdata['runtime'],'|')):''?>">
                            <span class="ui-form-other ui-form-explain"></span>
							<input type="text" id="result_aa" readonly="true" style="border-style:none;width: 200px;">
                        </div>
                        <div class="land ui-form-item">
							<!--<input type="hidden" name="end_place_tude" id="result_b"/>-->
                            <label class="ui-label"><span class="ui-form-required">*</span>目的地</label>
                            <input class="ui-input" data-required="1" name="end_place" id="addressInp" type="text" value="<?=!empty($jdata['runtime'])?substr($jdata['runtime'],strpos($jdata['runtime'],'|')+1):''?>">
                            <span class="ui-form-other ui-form-explain"></span>
							<input type="text" id="result_bb" readonly="true" style="border-style:none;width: 200px;">
                        </div>
                    <?}?>
                    <?if($ptype!='C'){//不是酒店,主题?>
                    <div class="ui-form-item">
                        <label class="ui-label"><?=$FieldList[$ptype]['topic']['t']?></label>
                        <ul class="topicList">
                            <?foreach($ProdcutTopic as $topic){?>
                                <li><label><input type="checkbox" name="topic[]" <?=in_array($topic, $topicList) ? 'checked':''?> value="<?=$topic?>"/><?=$topic?></label></li>
                            <?}?>
                            <li style="width:500px"><label>自定义主题:&nbsp;<input type="checkbox" name="topic[]" <?if($endtopic&&!in_array($endtopic,$ProdcutTopic))echo 'checked';?> id="shuchu" value="无"/></label><input type="text" id="shuru" value="<?=!in_array($endtopic,$ProdcutTopic) ? $endtopic:''?>">自定义主题不能超过6个字</li>
                        </ul>
                    </div>
                    <?}?>
                    <?if($ptype=='H'){//演出选择场馆?>
                    选择场馆:<?
                        /* pft_venues表不存在
                        $sql = "select * from pft_venues where apply_did={$_SESSION['sid']}";
                        $GLOBALS['le']->query($sql);
                        while($row=$GLOBALS['le']->fetch_assoc()){
                            $venues[] = $row;
                        }
                        echo GetHtmlSelect($venees,'venues','','');
                        */
                        ?>
                    <?}?>
                    <div class="ui-form-item">
                        <label class="ui-label">
                            <span class="ui-form-required">*</span>
                            <?=$FieldList[$ptype]['jqts']['t']//预订须知?>
                        </label>
                        <textarea id="buyTips" name="buyTips" data-required="2" title="请输入购买须知"class="ui-textarea w634"><?=isset($jdata['jqts'])?$jdata['jqts']:$FieldList[$ptype]['jqts']['tp']?></textarea>
                        <a href="javascript:" title="添加一行" class="dbtn addclom">+</a>
                        <a href="javascript:" title="减少一行" class="dbtn cutclom">-</a>
                    </div>
                    <div class="ui-form-item">
                        <label class="ui-label">
                            <span class="ui-form-required">*</span>
                            <?=$FieldList[$ptype]['bhjq']['t']//详情介绍?>
                        </label>
                        <textarea id="detailInfo" name="detailInfo" data-required="2" title="请输入<?=$FieldList[$ptype]['bhjq']['t']?>" ><?=isset($jdata['bhjq'])?$jdata['bhjq']:$FieldList[$ptype]['bhjq']['tp']?><?=$package_content?></textarea>
                    </div>
                    <?if(isset($FieldList[$ptype]['jtzn'])){//交通指南?>
                        <div class="ui-form-item">
                            <label class="ui-label"> <?=$FieldList[$ptype]['jtzn']['t']?> </label>
                            <textarea id="traffic" name="trafficInfo" class="ui-textarea w634"><?=isset($jdata['jtzn'])?strip_tags(htmlspecialchars_decode($jdata['jtzn'])):$FieldList[$ptype]['jtzn']['tp']?></textarea>
                            <a href="javascript:" title="添加一行" class="dbtn addclom">+</a>
                            <a href="javascript:" title="减少一行" class="dbtn cutclom">-</a>
                            <p class="ui-form-explain">填写交通路线等信息</p>
                        </div>
                    <?}?>
                    <?if($access['yd']):?>
                    <?foreach($imgArr as $k=>$v):?>
                    <!--图片上传-->
                    <div class="ui-form-item" style="position: relative;">
                        <input type="hidden" class="thumb_img" value="<?=$v?>" name="thumb_img[]"/>
                        <label class="ui-label">
                            <span class="ui-form-required"></span>主题图片:
                        </label>
                        <a class="lnk_prv" target="_blank" title="点击查看原图" href="<?=$v?>">
                        <img style="width:240px;height:160px;" src="<?=$v?>" class="preview" />
                        </a>
                        <div class="uploadImg">
                        <p class="title">重新上传缩略图：</p>
                        <input type="file"  class="imgup"/>
                        <input type="button" class="BtnUpload" value="上传" class="ui-button ui-button-swhite"/>
                        <p class="ui-form-explain">点击上传JPG或GIF格式的图片,<br/>建议图片尺寸：宽600像素，高365像素</p>
                        <p class="waitingUpload" class="ui-form-other"></p>
                        </div>
                        <p class="ui-form-explain">最佳尺寸为600*365px</p>
                    </div>
                    <!--图片上传结束-->
                    <?endforeach;?>
                    <!--thumb image-->
                    <?else:?>
                    <!--thumb image-->
                    <div class="ui-form-item" style="position: relative;">
                        <input type="hidden" name="thumb_img" id="thumb_img" value="<?=$imgUrl?>"/>
                        <label class="ui-label">
                            <span class="ui-form-required">*</span>缩略图
                        </label>
                        <a id="lnk_prv" target="_blank" title="点击查看原图" href="<?=$imgUrl?>">
                            <img style="width:240px;height:160px;" src="<?=$imgUrl?>" id="preview" />
                        </a>
                        <div class="uploadImg">
                            <p class="title">重新上传缩略图：</p>
                            <input type="file" name="upfile" id="imgup"/>
                            <input type="button" id="BtnUpload" value="上传" class="ui-button ui-button-swhite"/>
                            <p class="ui-form-explain">点击上传小于1M的JPG或GIF格式的图片,<br/>建议图片尺寸：宽350像素，高230像素</p>
                            <p id="waitingUpload" class="ui-form-other"></p>
                        </div>
                        <p class="ui-form-explain">默认将使用商户提供的缩略图作为页面展示的图片</p>
                    </div>
                    <!--thumb image-->
                    <?endif;?>
					<!-- <?if($_SESSION['sid']==1433||$_SESSION['sid']==7508):?>
					   <div class="ui-form-item">
							<label class="ui-label"><span class="ui-form-required">*</span>360全景</label>
							<a class="lnk_prv" style="display:none" href="<?=$panorama?>">
								<input type="hidden" name="upfile_allvideo" class="thumb_img" value="<?=$panorama?>"/>
								<img style="width:240px;height:160px;" src="<?=$panorama?>" class="preview" />
							</a>
							<input type="file" name="upfile_allvideo" class="imgup3"/>
							<input type="button" class="BtnUploada" value="上传" class="ui-button ui-button-swhite"/>
							<p class="ui-form-explain">点击上传小于3M的360全景文件</p>
							<p class="waitingUpload3" class="ui-form-other"></p>
						</div>
					<?endif;?> -->
                    <div class="ui-form-item"><?=$saveBtn?></div>
                </fieldset>
            </form>
        </div>
    </div>
</div>
</div>
<div id="msg_wrap">
    <div id="result_msg">数据提交中，请稍等</div>
    <p id="confrim_wrap" style="display: none;">
        <button class="closeWrap ui-button ui-button-sblue">确定</button>
    </p> 
</div>
<ul id="mainAreas"></ul>
<iframe src="about:blank" style="display: none;" id="hideFrame" name="hideFrame" frameborder="0"></iframe>
<script src="http://www.12301.cc/js/getaress.js" type="text/javascript"></script>
<!-- 配置文件 -->

<?if($_SERVER["HTTP_HOST"]=="www.12301.cc":?>
<script type="text/javascript" charset="utf-8" src="http://www.12301.cc/ue/ueditor_config_mini.js"></script>
<?php else:?>
<script type="text/javascript"  src="http://www.12301.cc/ue/ueditor_config_mini_dt.js" charset="utf-8"></script>
<?php endif;?>
<!-- 核心文件 -->
<script type="text/javascript" src="http://www.12301.cc/js/easydialog.min.js" ></script>
<script type="text/javascript" src="http://www.12301.cc/ue/ueditor.all.min.js"></script>
<script type="text/javascript" src="http://www.12301.cc/js/prod_pub.js"></script>
<!--<script type="text/javascript" src="http://www.12301.cc/js/point_a.js"></script>-->
<?php if($_GET['sync'] && $_GET['sync']=='225800'):?>
<script type="text/javascript" src="http://www.12301.cc/js/prod_editk_sync.js?body=1"></script>
<?php else:?>

<?php endif;?>
<?if($ptype=='B'){?>
    <script type="text/javascript" src="http://www.12301.cc/js/area.js"></script>
    <script type="text/javascript" src="http://www.12301.cc/js/area_complete.js"></script>
    <!--<script type="text/javascript" src="http://www.12301.cc/js/point_b.js"></script>-->
<?}?>
<script src="js/jquery.blockUI.js"></script>
<?if($_SESSION['sid']==1433||$_SESSION['sid']==7508):?><!--云游发布景区与酒店时 需要添加子景点的js-->
<script type="text/javascript" src="http://www.12301.cc/js/prod_editk_v3_yun.js"></script>
<?else:?>
<script type="text/javascript" src="http://www.12301.cc/js/prod_editk_v3.js"></script>
<?endif;?>
<script type="text/javascript" src="http://www.12301.cc/js/getLngLatByAddress.js"></script>
<script type="text/javascript">
	//输入地址获取该地址的经纬度
	//当产品是路线产品时,经纬度只取目的地， 出发地忽略
	$(window).on("load",function(){
		var resultHidInp = $("#ccid2");
		var citySelect = $("#d_city");
		var addressInp = $("#addressInp");
		var getLngLat = function(){
			var city = citySelect.find("option:selected").text();
			var address = addressInp.val();
			city = (addressInp.attr("name")=="end_place") ? address : city;
			LngLat.getByAddress(city,address,{
				loading : function(){
					console && console.log("city="+city+" address="+address);
					console && console.log("loading:正在获取经纬度");
				},
				success : function(point){
					console && console.log("success:"+point.lng+","+point.lat);
					resultHidInp.val(point.lng+","+point.lat);
				},
				fail : function(){
					console && console.log("complete:获取经纬度失败");
					resultHidInp.val("0,0");
				},
				error : function(){
					console && console.log("参数缺省city或address");
				}
			})
		}
		citySelect.on("change",getLngLat)
		addressInp.on("blur",getLngLat)
	})
</script>
<!--日历-->
<!-- <script type="text/javascript" src="js/calendar.js"></script>-->